import React from 'react'
import { Route, Switch } from 'react-router-dom'
import HomePage from '../page/home_page'
import LoginPage from '../page/login_page'
import TopicListPage from '../page/topic_list_page'
import TopicDetailPage from '../page/topic_detail_page'
import UserCenterPage from '../page/user_center_page'
import PostDetailPage from '../page/post_topic_page'

const RouterMap = () => (
  <Switch>
    <Route path="/" exact component={HomePage} />
    <Route path="/login/:redirect?" component={LoginPage} />
    <Route path="/topic-list/:tab" component={TopicListPage} />
    <Route path="/topic-detail/:topicId" component={TopicDetailPage} />
    <Route path="/user/:loginName?" component={UserCenterPage} />
    <Route path="/post/:action?" component={PostDetailPage} />
  </Switch>
)
export default RouterMap
